package com.theeviljames.coursework;

import java.util.Vector;

import com.theeviljames.coursework.ann.ANN;
import com.theeviljames.coursework.problems.ThreeBitParity;

public class TimeTest {

	public static long parityTime(String string){
		int parity = 0;
		long start = System.nanoTime();
		for(char c:string.toCharArray())parity = (parity==1)?((c=='1')?0:1):((c=='0')?0:1);
		return System.nanoTime()-start;
	}
	
	public static void main(String[] args) {
		long anntotal = 0;
		for(int i = 0; i < 100; i++){
			ANN ann = new ANN(new int[]{3,3,2},0.5,0.7,true);
			long start = System.nanoTime();
			ann.run(new ThreeBitParity(), 10000, 0.1);
			anntotal += System.nanoTime()-start;
		}
		long statetotal = 0;
		for(int i =0; i < 100; i++){
			statetotal += parityTime("111");
		}
		System.out.println("ANN averaged >" + anntotal/100);
		System.out.println("State averaged >" + statetotal/100);
		
	}
}
